home *** CD-ROM | disk | FTP | other *** search
/ Aminet 21 / Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso / Aminet / dev / e / Chris_emods.lha / testprogresswin.e < prev   
Text File  |  1997-08-20  |  1KB  |  77 lines

  1. /* This example doesn't work and I don't know why.
  2.    It crashes after locking the screen. But it works
  3.    when I use it in EvenMore. Oh well. */
  4.  
  5.  
  6. /* (Not so strange really, you forgot to open the libs :-) */
  7.  
  8. OPT OSVERSION=37,
  9.     REG=5
  10.  
  11. MODULE '*progresswin',
  12.        'gadtools',
  13.        'diskfont'
  14.  
  15. PROC main() HANDLE
  16. DEF count=NIL,
  17.     pw:progresswin
  18.  
  19. IF (diskfontbase:=OpenLibrary('diskfont.library',37))=FALSE THEN Raise()
  20. IF (gadtoolsbase:=OpenLibrary('gadtools.library',37))=FALSE THEN Raise()
  21.  
  22. openprogresswin(pw,NIL,NIL,'(pling) Elevator ready...')
  23.  
  24. Delay(75)
  25.  
  26. drawprogresstext(pw,'Going up...')
  27.  
  28. Delay(25)
  29.  
  30. FOR count:=0 TO 49
  31.     drawprogressgad(pw,count)
  32.     Delay(1)
  33. ENDFOR
  34.  
  35. drawprogresstext(pw,'Stand by...')
  36.  
  37. Delay(75)
  38. drawprogresstext(pw,'50 to go...')
  39.  
  40. FOR count:=50 TO 100
  41.     drawprogressgad(pw,count)
  42.     Delay(1)
  43. ENDFOR
  44.  
  45. drawprogresstext(pw,'(snap) Oops! No wire...')
  46.  
  47. Delay(75)
  48.  
  49. drawprogresstext(pw,'Gooing doooown...')
  50.  
  51. FOR count:=100 TO 50 STEP -1
  52.     drawprogressgad(pw,count)
  53.     Delay(1)
  54. ENDFOR
  55.  
  56. drawprogresstext(pw,'(Hick)...')
  57.  
  58. Delay(60)
  59.  
  60. drawprogresstext(pw,'50 to go...')
  61.  
  62. FOR count:=49 TO 0 STEP -1
  63.     drawprogressgad(pw,count)
  64.     Delay(1)
  65. ENDFOR
  66.  
  67. drawprogresstext(pw,'You can go home now...')
  68.  
  69. Delay(150)
  70.  
  71. EXCEPT DO
  72. closeprogresswin(pw)
  73. IF gadtoolsbase THEN CloseLibrary(gadtoolsbase)
  74. IF diskfontbase THEN CloseLibrary(diskfontbase)
  75. ENDPROC
  76.  
  77.